package cn.liu.jetpack_demo.routes

const val DEFAULT_ARGUMENT_KEY = "id"

const val DEFAULT_ARGUMENT_KEY2 = "name"

const val PASSPORT_ROUTE = "passport"
const val MAIN_ROUTE = "main"

sealed class Screen(val route: String) {
  object Home : Screen(route = "home_screen")
  object Detail :
    Screen(route = "detail_screen/{$DEFAULT_ARGUMENT_KEY}/{$DEFAULT_ARGUMENT_KEY2}") {
    //        fun passId(id: Int): String = "detail_screen/$id"
//        fun passId(id: Int) =
//            this.route.replace(oldValue = "{$DEFAULT_ARGUMENT_KEY}", newValue = id.toString())

    fun passNameAndId(id: Int, name: String): String {
      return "detail_screen/$id/$name"
    }


  }

  object UserList : Screen(route = "user_list")
  object StickyHeader : Screen(route = "sticky_header")

  object Login : Screen(route = "passport/login")
}